<!-- /* Description for file.
 *客户状态增加页面
 *
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/customerstates
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张朋2011年0701
 * @lastmodified  张朋2011年0701
 -->
<?php
echo $html->css ( 'tab' );
echo $html->css ( 'jquery-validate/css/screen' );
?> 

<script type="text/javascript">
//$(document).ready(function(){
//	$("#btnajaxAdd").click(function(){		
//			$.post(
//				'<?php echo ROOT_WEB_PATH; ?>/customerstates/add/',
//				{
//					data: {}
//	 				},
//				function()
//				{		
//						//$("#CustomerstateAddForm").submit();
//						//window.parent.location.reload();
//					}
//					);
//	});
//});
//Form验证
$(document).ready(function() {
	 $.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();
		  window.parent.location.reload();    
		}       
	});   
			
	// validate signup form on keyup and submit
	$("#CustomerstateAddForm").validate({
		rules: {
		 "data[Customerstate][customerStateName]": {
				required: true,string: true,stringMinLength:0,stringMaxLength:50
			}
		},
		messages: {
		},
		//设置验证触发事件 
		focusInvalid: false, 
		onkeyup: false, 
		//设置错误信息提示DOM  
		errorPlacement: function(error, element) { 
		error.appendTo( element.parent()); 
		}
	});
});
</script>

<div class="tabflex">
	<?php echo $form->create('Customerstate',array('action'=>'add','type'=> 'post'));?>
		<fieldset><legend><?php __('Add');?></legend>
		<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left;font-size:12px;">
			<tr>
			<td>
			<?php
				echo $form->hidden('creater');
				echo $form->hidden('updater ');?> </td>
			</tr>
			<tr>
				<td width="50"></td>
				<td width="100"><?php __('customerStateName');?>:<font color="red">*</font></td>
				<td colspan="4">
				<?php echo $form->input('customerStateName',array('size' => 80,'label'=>false));?>
				</td>
			</tr>
		</table>
		<table width="50%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
			<tr>
				<td width="50"></td>
				<td width="40"><?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?> <!-- __('reset', true)取消-->
				</td>
				<td width="40">
				<?php echo $form->button('确定',array('type'=>'submit','class'=>'oksubmit','id'=>'btnajaxAdd'));?> <!-- __('ok', true)确定-->
				</td>
				<td></td>
			</tr>
		</table>
		</fieldset>	
	<?php echo $form->end();?>
</div>
 